﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,user-scalable=0"/>
    <meta charset="UTF-8">
    <title>BD健身</title>
    <script src="__api__/js/fontSize.js"></script>
    <link rel="stylesheet" href="__api__/css/bootstrap.min.css">
    <link rel="stylesheet" href="__api__/css/reset.css">
    <link rel="stylesheet" href="__api__/css/my_main.css">
    <link rel="stylesheet" href="__api__/css/dropload.css">
    <script src="__assets__/js/jquery.min.js"></script>
    <script src="__assets__/layui.js"></script>
    <style>
        body{
            background: url("__api__/images/login_back.jpg") no-repeat;
            background-size: cover;
            width: 100%;
            height: 100%;
            position: fixed;
        }
    </style>
</head>
<body>
<div class="login">

    <div class="login_cont">
        <div class="container">
            <div class="loginTitle">
                <div class="logo">
                    <img src="__api__/images/logo.png">
                </div>
                <div class="title">
                    <img src="__api__/images/bd_title.png">
                </div>
            </div>

            <div class="myLogin">
        <div class="container">
            <header class="tabHead">
                <span class="active">用户登录</span>
                <a href="{:url('api/User/shangjiaLogin')}"><span>商家登录</span></a>
                <b class="border"></b>
            </header>
        </div>

    </div>

                <div class="formLogin">


                    <form action="#" class="form-horizontal form_login" onsubmit="return false">
                        <div class="form-group">
                            <input class="form-control" type="tel" name="telphone" placeholder="请输入手机号" required>
                        </div>
                        <div class="form-group number">

                            <input class="form-control" type="password" name="password" placeholder="请输入密码" required>
                        </div>
                        <div class="form-group loginBtn" id="sub">
                            <button class="btn btn-primary">
                                <span>登录</span>
                            </button>
                        </div>
                    </form>
                    <div class="remember">
                        <div class="checkbox pull-left">
                            <input class="magic-checkbox" type="checkbox" name="layout" id="c1" checked>
                            <label for="c1">记住密码</label>
                        </div>
                    <a href="{:url('api/user/regis')}" class="reg pull-right">
                        <span>注册</span>
                    </a>
                    <div class="log-other">
                        <div class="pwd"><a href="{:url('api/user/textlogins')}"><span>手机号登陆</span></a></div>

                        <div class="forget"><a href="{:url('api/user/forgetPwd')}"><span>忘记密码</span></a></div>
                    </div>
                </div>



            </div>
        </div>

    </div>


</div>

<script type="text/javascript">

$(function(){
$('#sub').click(function(){
	//alert('d');
	var layer;//全局变量 layui的弹窗
	layui.use('layer', function(){
		layer = layui.layer;
		});
	var url="{:url('api/user/Clogin')}";
	console.log("{:url('api/user/Clogin')}");
	var data=$("form").serialize();
	$.post(url,data,function(data){
		var obj=eval('('+ data +')');
		var msg=decodeURI(obj.info);
		//console.log(obj);
		if(obj.status==-1){
			layui.use('layer', function(){
				  var layer = layui.layer;
				  
				  layer.msg(msg, {icon: 6}); 
				});     
		}else if(obj.status==1){
			//$.amaran({'message':msg});
		    //console.log($.amaran);
		   layer.msg(msg, {
                      icon: 6,
              time: 2000 //2秒关闭（如果不配置，默认是3秒）
              },function(){
            	  var url = obj.data;
                  window.location.href=url; 
              });
  //do something
			
		}else if(obj.status==0){
			layer.msg(msg,{icon:5});
		}else {
			layer.msg(msg, {
                icon: 5,
        time: 2000 //2秒关闭（如果不配置，默认是3秒）
        },function(){
      	  var url = obj.data;
          window.location.href=url; 
        });
		}
	});
});
})

</script>
<script src="__api__/js/jquery-3.2.1.min.js"></script>
<script src="__api__/js/bootstrap.min.js"></script>
<script src="__api__/js/khData.js"></script>
</body>

</html>